<?php
/**
 * 留言 记录
 */

namespace app\admin\controller;


use app\admin\model\BulletinBoard;
use app\common\controller\Controller;
use think\Request;

use think\Db;
use think\Exception;

class Contact extends Controller
{

    public function getIndex(Request $request)
    {
        
        $keyword=$request->param('keyword');
       
        $order_type=$request->param('order_type',1);

        $search_type = $request->param('search_type');


        $query = BulletinBoard::getListQuery($keyword,$search_type);


        if($order_type == 1)
        {
            $query->order('record_time desc');
        }else{
            $query->order('record_time');
        }
        $this->assign([
            'list'=>$query->paginate(),
            'keyword'=>$keyword,
            'order_type'=>$order_type,
            'search_type'=>$search_type,
        ]);

        return $this->fetch('index');
    }

}